<template>
  <ux-table-column v-if="$attrs.ctype == 'selection'" v-bind="$attrs" :title="$attrs.label" :field="$attrs.prop" show-overflow-tooltip :width="colWidth" class-name="elx-table-td"/>
  <ux-table-column v-else-if="$attrs.ctype == 'index'" v-bind="$attrs" :title="$attrs.label" :field="$attrs.prop" show-overflow-tooltip align="center" :width="colWidth" class-name="elx-table-td"/>

  <ux-table-column v-else-if="$scopedSlots.edit && $attrs.hasOwnProperty('dictName')" v-bind="$attrs" :title="$attrs.label" :field="$attrs.prop" show-overflow-tooltip align="center" :width="colWidth" class-name="elx-table-td">
    <template v-slot:edit="scope">
      <slot name="edit" :row="scope.row"></slot>
    </template>
    <template v-slot="scope">
      <slot :row="scope.row">{{scope.row[scope.column.property] !== "" ? parseStatus(dict, $attrs.dictName, scope.row[scope.column.property]) : '-'}}</slot>
    </template>
  </ux-table-column>
  <ux-table-column v-else-if="$scopedSlots.edit" v-bind="$attrs" :title="$attrs.label" :field="$attrs.prop" show-overflow-tooltip align="center" :width="colWidth" class-name="elx-table-td">
    <template v-slot:edit="scope">
      <slot name="edit" :row="scope.row"></slot>
    </template>
  </ux-table-column>
  <!--  <ux-table-column v-else-if="$attrs.hasOwnProperty('searchable') && $scopedSlots.default" v-bind="$attrs" :field="$attrs.prop" show-overflow-tooltip :width="colWidth" class-name="elx-table-td">-->
  <!--    <template slot="header" slot-scope="{column}">-->
  <!--      <ad-table-header-filter v-bind="column"/>-->
  <!--    </template>-->
  <!--    <template slot-scope="{row}">-->
  <!--      <slot :row="row"></slot>-->
  <!--    </template>-->
  <!--  </ux-table-column>-->
  <!--  <ux-table-column v-else-if="$attrs.hasOwnProperty('searchable')" v-bind="$attrs" :field="$attrs.prop" show-overflow-tooltip :width="colWidth" class-name="elx-table-td">-->
  <!--    <template slot="header" slot-scope="{column}">-->
  <!--      <ad-table-header-filter v-bind="column"/>-->
  <!--    </template>-->
  <!--  </ux-table-column>-->
  <ux-table-column v-else-if="$scopedSlots.default" v-bind="$attrs" :title="$attrs.label" :field="$attrs.prop" show-overflow-tooltip :width="colWidth" class-name="elx-table-td">
    <template slot-scope="{row}">
      <slot :row="row"></slot>
    </template>
  </ux-table-column>
  <!--  <ux-table-column v-else v-bind="$attrs" :title="$attrs.label" :field="$attrs.prop" show-overflow-tooltip :width="colWidth" class-name="elx-table-td"/>-->
</template>

<script>
  import config from './mixins/config'
  import mixins from './mixins/index'
  export default {
    mixins: [ config, mixins ]
  }
</script>